$OpenBSD: patch-build_include_compat_h,v 1.2 2015/05/01 16:51:25 ajacoutot Exp $

this is committed upstream as of 2012-08-18, fixes build on hppa, ppc

--- build/include/compat.h.orig	Thu Aug  9 04:05:30 2012
+++ build/include/compat.h	Thu Aug  9 04:11:36 2012
@@ -140,7 +140,20 @@ static inline float nearbyintf(float x) 
 # endif
 # define B_ENDIAN_C_INLINE 1
 
-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#elif defined(__OpenBSD__)
+# include <endian.h>
+# if _BYTE_ORDER == _LITTLE_ENDIAN
+#  define B_LITTLE_ENDIAN 1
+#  define B_BIG_ENDIAN    0
+# elif _BYTE_ORDER == _BIG_ENDIAN
+#  define B_LITTLE_ENDIAN 0
+#  define B_BIG_ENDIAN    1
+# endif
+# define B_SWAP64(x) __swap64(x)
+# define B_SWAP32(x) __swap32(x)
+# define B_SWAP16(x) __swap16(x)
+
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
 # include <sys/endian.h>
 # if _BYTE_ORDER == _LITTLE_ENDIAN
 #  define B_LITTLE_ENDIAN 1
